
create  table jms_dm.dm_lmdm_four_segment_push_cainiao_hi (
   date_time string comment '分区',
   network_name string comment '网点名称',
   network_code string comment '网点名称code',
   courier_station_name string comment '驿站名称',
   courier_station_code string comment '驿站id',
   third_code string comment '3段码',
   next_station_code string comment '4段码',
   bill_num int comment '值',
   input_time string comment 'YYYY-MM-DD-HH'
) COMMENT '驿站码推送菜鸟'
PARTITIONED BY (dt STRING COMMENT '')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_lmdm_four_segment_push_cainiao_hi'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);


create  table jms_dm.dm_lmdm_four_segment_push_cainiao_hi (
   date_time date comment '分区',
   network_code varchar(300) comment '网点名称code',
   network_name varchar(300) comment '网点名称',
   courier_station_name varchar(300) comment '驿站名称',
   courier_station_code varchar(300) comment '驿站id',
   third_code varchar(300) comment '3段码',
   next_station_code varchar(300) comment '4段码',
   bill_num bigint comment '值',
   input_time datetime comment 'YYYY-MM-DD-HH'
)
ENGINE=OLAP
DUPLICATE KEY(date_time,network_code)
COMMENT "驿站码推送菜鸟"
PARTITION BY RANGE (date_time) (
    START ("2023-12-01") END ("2023-12-30") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(network_code) BUCKETS 3
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "3",
"in_memory" = "false",
"storage_format" = "V2"
);
